import com.lyj.pojo.Dog1;
import com.lyj.pojo.Dog2;
import com.lyj.pojo.Dog3;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class T {

    @Test
    public void TestDog(){
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring-config.xml");
        Dog1 dog1 = (Dog1) applicationContext.getBean("dog1");
        System.out.println("构造方法实现："+dog1);

        Dog2 dog2 = (Dog2) applicationContext.getBean("dog2");
        System.out.println("set方法实现："+dog2);

        Dog3 dog3 =  applicationContext.getBean("dog3",Dog3.class);
        System.out.println("注解实现："+dog3);

        System.out.println("-------aop实现--------");
        dog3.eat("骨头");
    }
}
